package stationGUI;


import java.applet.Applet;
import java.awt.*;

public class ColorBubble extends Applet {

  
 /**
   * 
   */
  private static final long serialVersionUID = 1L;


      private int mouseX, mouseY;
      private boolean mouseclicked = false;
   
      public void init() {
          setBackground(Color.magenta);
          
          
          
      }
   
      public boolean mouseDown(Event e, int x, int y ) {
          mouseX=x; mouseY=y;
          mouseclicked = true;
          repaint();
          return true;
      }

      public void paint( Graphics g ) {
          g.setColor(Color.blue);
          g.fillOval(200,25,40,40);
          g.fillOval(300,25,40,40);
          g.fillOval(125,200,40,40);
          g.fillOval(200,275,40,40);
          
          g.setColor(Color.GREEN);
          g.fillOval(300,275,40,40);
          g.fillOval(375,200,40,40);
          
          g.setColor(Color.RED);
          g.fillOval(375,100,40,40);
          g.fillOval(125,100,40,40);
          
          g.fillOval(250-10,150-10,60,60);
          
          if (mouseclicked) {
              g.fillOval((mouseX-20), (mouseY-20), 40, 40);
              mouseclicked = false;
          }
      }    

      public void update ( Graphics g ) {
          paint(g);
      }
}
